#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef struct
{
    int xueXiao;
    int keHou;
    int day;
    int sum;
} WEEK;
int main()
{
    WEEK week;
    WEEK chengDu;
    chengDu.sum = 0;
    for (int i = 1; i < 8; i++)
    {
        cin >> week.xueXiao >> week.keHou;
        if (week.xueXiao + week.keHou > chengDu.sum)
        {
            chengDu.sum = week.xueXiao + week.keHou;
            chengDu.day = i;
        }
    }
    cout << chengDu.day << endl;
}